<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.min.js"></script>
</head>
<body>
    <div id="panel" style="width: 100%; height: 400px;">

    </div>
    <script>
        //实例化画布
         var myChart = echarts.init(document.getElementById('panel')); 
        //编写数据参数
        option1 = {
            title: {
                text: '某站点用户访问来源',
                subtext: '纯属虚构',
                left: 'center'
            },
            tooltip: {
                trigger: 'item'
            },
            legend: {
                orient: 'vertical',
                left: 'left',
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: '50%',
                    data: [
                        {value: 1048, name: '搜索引擎'},
                        {value: 735, name: '直接访问'},
                        {value: 580, name: '邮件营销'},
                        {value: 484, name: '联盟广告'},
                        {value: 300, name: '视频广告'}
                    ],
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        var option = {
            title: {
                text: 'WEB六个阶段难度'
            },
            tooltip: {},
            legend: {
                data:['难度']
            },
            xAxis: {
                data: ["第一阶段","第二阶段","第三阶段","第四阶段","第五阶段","第六阶段"]
            },
            yAxis: {},
            series: [{
                name: '难度',
                type: 'bar',
                data: [3, 5, 10, 7, 5, 1]
            }]
        };
        //画布加载数据
        myChart.setOption(option1)
</script>
</body>
</html>